{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " \n",
      "0  \n",
      "0 1  \n",
      "0 1 2  \n",
      "0 1 2 3  \n",
      "0 1 2 3 4  \n",
      "0 1 2 3 4 5  \n",
      "0 1 2 3 4 5 6  \n"
     ]
    }
   ],
   "source": [
    "for i in range (8):\n",
    "    for j in range (i):\n",
    "        print(j,end=' ')\n",
    "    print(' ')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                *  \n",
      "              * * *  \n",
      "            * * * * *  \n",
      "          * * * * * * *  \n",
      "        * * * * * * * * *  \n",
      "      * * * * * * * * * * *  \n",
      "    * * * * * * * * * * * * *  \n",
      "  * * * * * * * * * * * * * * *  \n",
      "* * * * * * * * * * * * * * * * *  \n"
     ]
    }
   ],
   "source": [
    "contrl=9\n",
    "blank=int((contrl*2+1)/2)\n",
    "li=' '\n",
    "for i in range (contrl):\n",
    "    for j in range (blank-i-1):\n",
    "        print(' ',end=' ')\n",
    "    for j in range (i*2+1):    \n",
    "        print('*',end=' ')\n",
    "    print(' ')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
